package com.lantosec.hmrp.modules.workflow.enumeration;

/**
 * 流程参数枚举
 */
public enum ProcessVariableEnum {
    /**
     * 用户Id，当前任务操作人
     */
    USER_ID("userId","用户Id"),

    /**
     * 主流程业务数据key
     */
    BUSINESS_KEY("businessKey","业务数据key"),

    /**
     * 业务数据（JSON）
     */
    BUSINESS_DATA("businessData","业务数据"),

    /**
     * 会签通过比率（0-100）
     */
    //RATIO("ratio","会签通过比率"),

    PARTY_USER_ID_LIST("partyUserIdList","会签操作人用户Id列表"),

    AUDIT_STATUS("auditStatus","审核状态 1 通过，0 不通过"),
    /**
     * JSON结构，见 TaskCountersignVO
     */
    VOTE_OPERATOR("oneVoteSetting","一票权配置"),

    AGREE_COUNT("agreeCount","会签同意数量"),

    DISAGREE_COUNT("disagreeCount","会签不同意数量"),

    COMMENT("comment", "审核意见");

    private String code;
    private String name;

    ProcessVariableEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static ProcessVariableEnum getByCode(String code) {
        for (ProcessVariableEnum item : ProcessVariableEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return ProcessVariableEnum.COMMENT;
    }
}
